package com.fh.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fh.mapper.TProductMapper;
import com.fh.model.TProduct;
import com.fh.service.ProductService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
public class ProductServiceImpl implements ProductService {
    @Resource
    private TProductMapper productMapper;
    @Override
    public List<TProduct> queryProduct() {
        List<TProduct> tProducts = productMapper.selectList(null);

        return tProducts;
    }

    @Override
    public TProduct queryProductListById(Long pid) {
        QueryWrapper queryWrapper=new QueryWrapper();
        queryWrapper.eq("pid",pid);
        return productMapper.selectOne(queryWrapper);
    }
}
